<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="800px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="12" >
                <el-form-item  label="任务类型"  
 prop="tasktype" >
                        <p>{{dataForm.tasktype}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="任务内容"  
 prop="taskcontent" >
                        <p>{{dataForm.taskcontent}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="开始时间"  
 prop="starttime" >
                        <p>{{jnpf.dateFormat(dataForm.starttime)}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="结束时间"  
 prop="endtime" >
                        <p>{{jnpf.dateFormat(dataForm.endtime)}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="工期时间"  
 prop="projecttime" >
                        <p>{{dataForm.projecttime}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="任务完结时间"  
 prop="taskendtime" >
                        <p>{{jnpf.dateFormat(dataForm.taskendtime)}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="执行人"  
 prop="operator" >
                        <p>{{dataForm.operator}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="任务状态"  
 prop="taskstatus" >
                        <p>{{dataForm.taskstatus}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="责任人"  
 prop="dutyperson" >
                        <p>{{dataForm.dutyperson}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="责任部门"  
 prop="dutydepartment" >
                        <p>{{dataForm.dutydepartment}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12" >
                <el-form-item  label="责任领导"  
 prop="dutyleader" >
                        <p>{{dataForm.dutyleader}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="创建用户"  
 prop="creatoruserid" >
                        <p>{{dataForm.creatoruserid}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="创建时间"  
 prop="creatortime" >
                        <p>{{dataForm.creatortime}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="修改用户"  
 prop="lastmodifyuserid" >
                        <p>{{dataForm.lastmodifyuserid}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="修改时间"  
 prop="lastmodifytime" >
                        <p>{{dataForm.lastmodifytime}}</p>
                </el-form-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            tasktype : "",
                            taskcontent : '',
                            starttime : '',
                            endtime : '',
                            projecttime : '',
                            taskendtime : '',
                            operator : '',
                            taskstatus : "1",
                            dutyperson : '',
                            dutydepartment : '',
                            dutyleader : '',
                            creatoruserid : "",
                            creatortime : "",
                            lastmodifyuserid : "",
                            lastmodifytime : "",
            },

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/BusTask/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
